package setting
import (
	"gopkg.in/ini.v1"
)

var Conf = new(Config)
type Config struct {
	Release      bool `ini:"release"`
	Port         int  `ini:"port"`
	*MySQLConfig `ini:"mysql"`
}

type MySQLConfig struct {
	UserName string `ini:"dbusername"`
	Password string `ini:"dbpasswd"`
	DB       string `ini:"dbname"`
	Host     string    `ini:"dbhost"`
	DBPort     int    `ini:"dbport"`
}

func Init(file string) error {
	//需要指定  gopkg.in/ini.v1 v1.55.0
	return ini.MapTo(Conf, file)
}